Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #3955 #3956

Closed
wants to merge 1 commit into from
Closed

Fix for #3955 #3956

wants to merge 1 commit into from

Conversation

jpaas
Copy link
Contributor

@jpaas jpaas commented Nov 27, 2015

Ref #2955


if (attrs) {
for (key in attrs) {
var normalizedKey = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could leave the declaration in top and just set normalizedKey = payloadKey in the for. That way we don't have to do the extra check on line 736.

@wecc
Copy link
Contributor

wecc commented Nov 30, 2015

Would be great if you could add a test for this.

@bmac
Copy link
Member

bmac commented Dec 3, 2015

Hey @jpaas. I'd love to get this bug fixed and this pr merged. Let me know if you need any direction with adding the test.

@jpaas
Copy link
Contributor Author

jpaas commented Dec 3, 2015

@bmac Sorry I haven't had a chance to look at this yet, but I will try this weekend. I don't know anything about the tests for this project, so if I have any questions I'll let you know.

@fivetanley
Copy link
Member

@jpaas LGTM, can you squash to one commit and prefix the commit message with [BUGFIX beta] ?


var post = env.store.serializerFor("post").normalizeResponse(env.store, Post, jsonHash, '1', 'findRecord');

assert.equal(post.data.attributes.title, "Rails is omakase");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just curious, but according to the test description, it looks like there should be an assertion which checks that notInMapping is not serialized, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya I suppose there should be an assert that checks it isn't added, but the primary problem this PR is trying to fix is that the value of notInMapping gets assigned to the title key.

@bmac
Copy link
Member

bmac commented Dec 8, 2015

LGTM

@bmac
Copy link
Member

bmac commented Dec 11, 2015

@jpaas Do you have time to squash this pr. Let me know if you need help with the git commands to do the squash.

@jpaas
Copy link
Contributor Author

jpaas commented Dec 13, 2015

@bmac Yes please, I could use some help on what you're looking for me to do here.

@bmac
Copy link
Member

bmac commented Dec 13, 2015

@jpaas.

The easiest way to squash this down would be to use the interactive rebase command. You can start it using the following command which tells git you would like to edit the last 4 commits on this branch.

git rebase -i HEAD~4

After you run that git should open up you editor with the following text:

pick a607971 ignores keys that are not found in the map                        
pick 6afdf26 after testing, need to explicitly set normalizedKey to null
pick f7f88ba implements requested changed and adds test
pick 6944873 fixes lint errors

We want to tell git to keep the first commit and "fixup" the 3 commits after that. "fixup" merges the commits with the previous commit and discards the commit message. We can do that by changing the word pick to fixup (or f).

Edit the file to look like this and save and close your editor.

pick a607971 ignores keys that are not found in the map                        
f 6afdf26 after testing, need to explicitly set normalizedKey to null
f f7f88ba implements requested changed and adds test
f 6944873 fixes lint errors

After closing the editor git will merge the last 3 commits with the first commit. You can now force push your issue_3955 branch to this pr by running the following command: git push -f origin issue_3955

I hope this helps. Let me know if you run into any trouble.

@jpaas
Copy link
Contributor Author

jpaas commented Dec 14, 2015

@bmac Thanks for the git masterclass :) Hopefully I did it right. It now looks like there are some conflicts. Not sure if that's something I need to worry about or whoever is merging the PR.

@bmac
Copy link
Member

bmac commented Dec 22, 2015

Thanks @jpaas. This commit was merged as 72a6290

@bmac bmac closed this Dec 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants